create-usb: Always use archive mode
authorMatthew Leeds <matthew.leeds@endlessm.com>
Fri, 21 Sep 2018 22:35:50 +0000 (15:35 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 25 Sep 2018 13:52:38 +0000 (13:52 +0000)
commitfc357adb7915c80037136b16dc519cf645e33e36
tree55ad1168c6edb0fed4499b4f64c6d7c3ba2b91cc
parent4aadbe2159cd6096529d147dba8bd13470903039
create-usb: Always use archive mode

Change the create-usb command so that it always creates the destination
repository using the "archive" mode, rather than using archive mode when
xattrs aren't supported and bare-user otherwise. This has a few
advantages:

1. The archive mode works with FAT filesystems, which is what most
USB drives are, and which doesn't support xattrs.

2. At least in some quick testing I did, archive mode is about
twice as performant as bare-user mode, in terms of how long it takes for
the create-usb command to complete.

3. This ensures that a tool can safely change the permissions on
".ostree/repo" and subdirectories after create-usb completes, which is
important for Endless since otherwise you can't use `ostree create-usb`
as root and then `flatpak create-usb` as a non-root user on the same USB
drive (or in other words copy OS updates and apps to the same USB).

Closes: #1733
Approved by: cgwalters
src/ostree/ot-builtin-create-usb.c